package com.aifund.common.dao;

import com.aifund.common.entity.UserInvitation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface UserInvitationDao extends JpaRepository<UserInvitation,Long> {

    @Query(nativeQuery = true,value = "select count(*) from user_invitation where is_del = 0")
    Integer getUserInvitationNum(Long userId);//查询用户邀请人数

    @Query(nativeQuery = true,value = "select count(*) from user_invitation where is_del = 0 and datediff(create_time,now())=0")
    Integer getUserInvitationNumToday(Long userId);//查询用户今日邀请人数

}
